//替代假子弹的固定不动的子弹，起反弹作用


module py2Obj {



	export class fixBullet extends basicObj {
		//保存外部的物理世界
		private bulletType: any;
		public isRun = false;
		public constructor(world: any, gamePanle: any, romveSkins: any) {
			super(world, gamePanle, romveSkins);
			this.objkind = 102;

		}

		public init() {
			super.init();


		}

	
		public createMyRigidbody(): p2.Body {
			var world: P2World = this.m_world;
			var skin: MImage = this.createSkin("ball_png");
			var body: p2.Body = world.createCircleBodyShape(skin.width >> 1);
			body.userData.skin = skin;
			body.userData.data = this;
			body.mass = 0;//质量设置为0，就可以按规定方向发射，等发生碰撞之后再给球质量
			//body.gravityScale=0;
			var shape = body.shapes[0];
			shape.collisionGroup = 2;//010与001为0，010与110为1
			// shape.collisionMask=2;
			// trace(shape.collisionGroup,shape.collisionMask)
			return body;
		}
		private createFixedBullet() {

		}

	
	
		/**
		 * Body.KINEMATIC = 4;
		 * Body.STATIC = 2;
		 * Body.DYNAMIC = 1;
		 */
		public getCollision(otherBody: basicObj) {

			// if(otherBody.objkind==301)
			// {
			// 	 otherBody.getBody().applyImpulse([this.m_body.position[0] * 2, 0], [0, 0]);
			// }
			// 	this.setPostion(this.m_body.position[0], this.m_body.position[1]);

		
		}
	}
}